﻿<%@ Page Title="Outcome Details :: Re-SeSS" Language="C#" MasterPageFile="~/Main.Master" AutoEventWireup="true" CodeBehind="OutcomeDetails.aspx.cs" Inherits="ReSeSSApplication.OutcomeDetails" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

    <style type="text/css">
        
        .ui-tabs-panel { height: 450px; overflow-y: auto; }
        .table .label-success { white-space: normal; }
        
        .nav { margin: 0; }
        .tab-content { padding-top: 18px; background: #ffffff; border: 1px solid #DDDDDD; border-top: 0; }
        .tab-pane { height: 450px; overflow-y: auto; }
        
        /* left */
        #CodeRadioSetDiv,
        #CodeRestrictRadioSetDiv,
        #DateTimeRadioSetDiv,
        #ReadingsRadioSetDiv,
        #ReadingsRestrictRadioSetDiv,
        #TextRadioSetDiv,
        #TextRestrictRadioSetDiv,
        #RadiologyRadioSetDiv,
        #RadiologyRestrictRadioSetDiv,
        #SnomedCtRadioSetDiv,
        #SnomedCtRestrictRadioSetDiv { padding: 10px 10px 0;}
        
        #CodeRadioSetDiv input,
        #CodeRestrictRadioSetDiv input,
        #DateTimeRadioSetDiv input,
        #ReadingsRadioSetDiv input,
        #ReadingsRestrictRadioSetDiv input,
        #TextRadioSetDiv input,
        #TextRestrictRadioSetDiv input,
        #RadiologyRadioSetDiv input,
        #RadiologyRestrictRadioSetDiv input,
        #SnomedCtRadioSetDiv input,
        #SnomedCtRestrictRadioSetDiv input { display: inline-block; clear: left; margin-right: 5px; }
        
        #CodeRadioSetDiv label,
        #CodeRestrictRadioSetDiv label,
        #DateTimeRadioSetDiv label,
        #ReadingsRadioSetDiv label,
        #ReadingsRestrictRadioSetDiv label,
        #TextRadioSetDiv label,
        #TextRestrictRadioSetDiv label,
        #RadiologyRadioSetDiv label,
        #RadiologyRestrictRadioSetDiv label,
        #SnomedCtRadioSetDiv label,
        #SnomedCtRestrictRadioSetDiv label { display: inline-block; line-height: 14px; }
    
        /* right */
        #CodeListContainer,
        #CodeRestrictListContainer,
        #DateTimeContainerDiv,
        #ReadingsListContainer,
        #ReadingsRestrictListContainer,
        #TextContainerDiv,
        #TextRestrictListContainer,
        #RadiologyListContainer,
        #RadiologyRestrictListContainer,
        #SnomedCtListContainer,
        #SnomedCtRestrictListContainer { padding: 10px 10px 0; }
        
        #bodyContent_ICD10ListDiv,
        #bodyContent_ICD9ListDiv,
        #bodyContent_ICD8ListDiv,
        #bodyContent_AGKListDiv,
        #bodyContent_LaboratoryListDiv, 
        #bodyContent_PharmaceuticalsListDiv,
        #bodyContent_MeasurementsListDiv,
        #bodyContent_MRIListDiv,
        #bodyContent_CTListDiv,
        #bodyContent_XRayListDiv,
        #bodyContent_USGListDiv,
        #bodyContent_SnomedCtListDiv {
            display: block;
            overflow-y: auto;
            width: 350px;
            height: 430px;
            padding-right: 3px;
        }
        #bodyContent_PharmaceuticalsListDiv {
            width: 100%;
        }
        
        #bodyContent_ICD10ListDiv table,
        #bodyContent_ICD9ListDiv table,
        #bodyContent_ICD8ListDiv table,
        #bodyContent_AGKListDiv table,
        #bodyContent_LaboratoryListDiv table, 
        #bodyContent_PharmaceuticalsListDiv table,
        #bodyContent_MeasurementsListDiv table,
        #bodyContent_MRIListDiv table,
        #bodyContent_CTListDiv table,
        #bodyContent_XRayListDiv table,
        #bodyContent_USGListDiv table,
        #bodyContent_SnomedCtListDiv table {
            width: 320px;
        }
        #bodyContent_PharmaceuticalsListDiv table 
        {
            width: 580px;
            font-size: 11px;
        }
        #bodyContent_PharmaceuticalsListDiv { width: 600px; }
        
        #bodyContent_ICD10ListGridView tr.label-success:hover td,
        #bodyContent_ICD9ListGridView tr.label-success:hover td,
        #bodyContent_ICD8ListGridView tr.label-success:hover td,
        #bodyContent_AGKListGridView tr.label-success:hover td,
        #bodyContent_LaboratoryListGridView tr.label-success:hover td,
        #bodyContent_PharmaceuticalsListGridView tr.label-success:hover td,
        #bodyContent_MeasurementsListGridView tr.label-success:hover td,
        #bodyContent_MRIListGridView tr.label-success:hover td,
        #bodyContent_CTListGridView tr.label-success:hover td,
        #bodyContent_XRayListGridView tr.label-success:hover td,
        #bodyContent_USGListGridView tr.label-success:hover td,
        #bodyContent_SnomedCtListDiv tr.label-success:hover td { 
            background-color: #38B44A;
        }
        
        #bodyContent_txtICD10ListQuickFind,
        #bodyContent_txtICD9ListQuickFind,
        #bodyContent_txtICD8ListQuickFind,
        #bodyContent_txtAGKListQuickFind,
        #bodyContent_txtLaboratoryListQuickFind,
        #bodyContent_txtPharmaceuticalsListQuickFind,
        #bodyContent_txtMeasurementsListQuickFind,
        #bodyContent_txtMRIListQuickFind,
        #bodyContent_txtCTListQuickFind,
        #bodyContent_txtXRayListQuickFind,
        #bodyContent_txtUSGListQuickFind,
        #bodyContent_txtSnomedCtListQuickFind { 
            width: 320px;
            height: 32px; 
            -ms-box-sizing: border-box; 
            -moz-box-sizing: border-box; 
            -webkit-box-sizing: border-box; 
            box-sizing: border-box;
        }
        #bodyContent_txtPharmaceuticalsListQuickFind {
            width: 580px;
        }
        
    </style>

    <script type="text/javascript">
        jQuery(document).ready(function () {

            /**
            * Outcome details tab
            ********************************************************************************/

            var currentTab = jQuery('#bodyContent_CurrentTabHiddenField').val();
            if (currentTab == '' || currentTab == '0') {
                currentTab = 'tabs-code-specify';
                jQuery('#bodyContent_CurrentTabHiddenField').val(currentTab);
            }
            jQuery('#OutcomeTabs a[href="#' + currentTab + '"]').tab('show');

            jQuery('a[data-toggle="tab"]').on('shown', function (e) {
                var tar = e.target.toString();
                tar = tar.split("#");
                jQuery('#bodyContent_CurrentTabHiddenField').val(tar[1]);

                SetupBackNNextButton();
            });

            SetupBackNNextButton();

            jQuery('#NextTab').click(function () {

                var disabledAttr = jQuery(this).attr('disabled');
                if (typeof disabledAttr !== 'undefined' && disabledAttr !== false) {
                    return false;
                }

                var nextFlag = false;
                var nextCurrtab = '';
                var currTab = jQuery('#bodyContent_CurrentTabHiddenField').val();

                jQuery('#OutcomeTabs a[data-toggle="tab"]').each(function () {
                    if (nextFlag) {
                        nextCurrtab = jQuery(this).attr('href').replace('#', '');
                        jQuery('#bodyContent_CurrentTabHiddenField').val(nextCurrtab);
                        nextFlag = false;
                    }
                    if (jQuery(this).attr('href').toUpperCase() == '#' + currTab.toUpperCase()) {
                        nextFlag = true;
                    }
                });

                jQuery('#OutcomeTabs a[href="#' + nextCurrtab + '"]').tab('show');
                SetupBackNNextButton();
                return false;
            });

            jQuery('#BackTab').click(function () {

                var disabledAttr = jQuery(this).attr('disabled');
                if (typeof disabledAttr !== 'undefined' && disabledAttr !== false) {
                    return false;
                }

                var backFlag = false;
                var currTab = jQuery('#bodyContent_CurrentTabHiddenField').val();
                var prevTab = '';

                jQuery('#OutcomeTabs a[data-toggle="tab"]').each(function () {
                    if (jQuery(this).attr('href').toUpperCase() == '#' + currTab.toUpperCase()) {
                        jQuery('#bodyContent_CurrentTabHiddenField').val(prevTab);
                        backFlag = true;
                    }
                    if (!backFlag) {
                        prevTab = jQuery(this).attr('href').replace('#', '');
                    }
                });

                jQuery('#OutcomeTabs a[href="#' + prevTab + '"]').tab('show');
                SetupBackNNextButton();
                return false;
            });


            /**
            * script for 'Code' tab
            ********************************************************************************/

            /* filter table */
            var optionsICD10 = { additionalFilterTriggers: [jQuery('#bodyContent_txtICD10ListQuickFind')] };
            jQuery('#bodyContent_ICD10ListGridView').tableFilter(optionsICD10);
            jQuery('#bodyContent_ICD10ListGridView .filters').hide();

            var optionsICD9 = { additionalFilterTriggers: [jQuery('#bodyContent_txtICD9ListQuickFind')] };
            jQuery('#bodyContent_ICD9ListGridView').tableFilter(optionsICD9);
            jQuery('#bodyContent_ICD9ListGridView .filters').hide();

            var optionsICD8 = { additionalFilterTriggers: [jQuery('#bodyContent_txtICD8ListQuickFind')] };
            jQuery('#bodyContent_ICD8ListGridView').tableFilter(optionsICD8);
            jQuery('#bodyContent_ICD8ListGridView .filters').hide();

            var optionsAGK = { additionalFilterTriggers: [jQuery('#bodyContent_txtAGKListQuickFind')] };
            jQuery('#bodyContent_AGKListGridView').tableFilter(optionsAGK);
            jQuery('#bodyContent_AGKListGridView .filters').hide();

            /* show/hide logic (on load) */
            jQuery('#bodyContent_ICD10ListDiv').hide();
            jQuery('#bodyContent_ICD9ListDiv').hide();
            jQuery('#bodyContent_ICD8ListDiv').hide();
            jQuery('#bodyContent_AGKListDiv').hide();

            if (jQuery('#bodyContent_rbtnICD10Code').is(':checked')) {
                jQuery('#bodyContent_ICD10ListDiv').show();
            } else if (jQuery('#bodyContent_rbtnICD9Code').is(':checked')) {
                jQuery('#bodyContent_ICD9ListDiv').show();
            } else if (jQuery('#bodyContent_rbtnICD8Code').is(':checked')) {
                jQuery('#bodyContent_ICD8ListDiv').show();
            } else if (jQuery('#bodyContent_rbtnAGKCode').is(':checked')) {
                jQuery('#bodyContent_AGKListDiv').show();
            }

            /* show/hide logic (on click) */
            jQuery('#bodyContent_rbtnICD10Code').click(function () {
                jQuery('#bodyContent_ICD10ListDiv').show();
                jQuery('#bodyContent_ICD9ListDiv').hide();
                jQuery('#bodyContent_ICD8ListDiv').hide();
                jQuery('#bodyContent_AGKListDiv').hide();
            });

            jQuery('#bodyContent_rbtnICD9Code').click(function () {
                jQuery('#bodyContent_ICD10ListDiv').hide();
                jQuery('#bodyContent_ICD9ListDiv').show();
                jQuery('#bodyContent_ICD8ListDiv').hide();
                jQuery('#bodyContent_AGKListDiv').hide();
            });

            jQuery('#bodyContent_rbtnICD8Code').click(function () {
                jQuery('#bodyContent_ICD10ListDiv').hide();
                jQuery('#bodyContent_ICD9ListDiv').hide();
                jQuery('#bodyContent_ICD8ListDiv').show();
                jQuery('#bodyContent_AGKListDiv').hide();
            });

            jQuery('#bodyContent_rbtnAGKCode').click(function () {
                jQuery('#bodyContent_ICD10ListDiv').hide();
                jQuery('#bodyContent_ICD9ListDiv').hide();
                jQuery('#bodyContent_ICD8ListDiv').hide();
                jQuery('#bodyContent_AGKListDiv').show();
            });

            /* highlight selected code (on load) */
            jQuery('#bodyContent_ICD10ListGridView tr td input[type=hidden]').each(function () {
                if (jQuery(this).val() == jQuery('#bodyContent_CodeIdHiddenField').val()) {
                    jQuery(this).parent().parent().addClass('label label-success');
                }
            });

            jQuery('#bodyContent_ICD9ListGridView tr td input[type=hidden]').each(function () {
                if (jQuery(this).val() == jQuery('#bodyContent_CodeIdHiddenField').val()) {
                    jQuery(this).parent().parent().addClass('label label-success');
                }
            });

            jQuery('#bodyContent_ICD8ListGridView tr td input[type=hidden]').each(function () {
                if (jQuery(this).val() == jQuery('#bodyContent_CodeIdHiddenField').val()) {
                    jQuery(this).parent().parent().addClass('label label-success');
                }
            });

            jQuery('#bodyContent_AGKListGridView tr td input[type=hidden]').each(function () {
                if (jQuery(this).val() == jQuery('#bodyContent_CodeIdHiddenField').val()) {
                    jQuery(this).parent().parent().addClass('label label-success');
                }
            });

            /* highlight selected code (on click) */
            jQuery('.select-code').click(function () {
                jQuery(this).parent().parent().parent().find('tr').removeClass('label label-success');
                jQuery(this).parent().parent().addClass('label label-success');
                jQuery('#bodyContent_CodeIdHiddenField').val(jQuery(this).parent().find('input').val());
                return false;
            });


            /**
            * script for 'Code Restrict' tab
            ********************************************************************************/

            /* show/hide logic (on load) */
            jQuery('#bodyContent_CodeRestrictRelatedDiv').hide();
            jQuery('#bodyContent_CodeRestrictTimeIntervalDiv').hide();
            jQuery('#bodyContent_CodeRestrictRestrictByDiv').hide();

            if (jQuery('#bodyContent_rbtnCodeRestrictRelated').is(':checked')) {
                jQuery('#bodyContent_CodeRestrictRelatedDiv').show();
            } else if (jQuery('#bodyContent_rbtnCodeRestrictTimeInterval').is(':checked')) {
                jQuery('#bodyContent_CodeRestrictTimeIntervalDiv').show();
            } else if (jQuery('#bodyContent_rbtnCodeRestrictRestrictBy').is(':checked')) {
                jQuery('#bodyContent_CodeRestrictRestrictByDiv').show();
            }

            /* show/hide logic (on click) */
            jQuery('#bodyContent_rbtnCodeRestrictRelated').click(function () {
                jQuery('#bodyContent_CodeRestrictRelatedDiv').show();
                jQuery('#bodyContent_CodeRestrictTimeIntervalDiv').hide();
                jQuery('#bodyContent_CodeRestrictRestrictByDiv').hide();

                jQuery('#bodyContent_CodeRestrictField1HiddenField').val(jQuery('#bodyContent_ddlCodeRestrictRelated').val());
                jQuery('#bodyContent_CodeRestrictField2HiddenField').val('');
            });

            jQuery('#bodyContent_rbtnCodeRestrictTimeInterval').click(function () {
                jQuery('#bodyContent_CodeRestrictRelatedDiv').hide();
                jQuery('#bodyContent_CodeRestrictTimeIntervalDiv').show();
                jQuery('#bodyContent_CodeRestrictRestrictByDiv').hide();

                jQuery('#bodyContent_CodeRestrictField1HiddenField').val(jQuery('#bodyContent_txtCodeRestrictTimeIntervalFrom').val());
                jQuery('#bodyContent_CodeRestrictField2HiddenField').val(jQuery('#bodyContent_txtCodeRestrictTimeIntervalTo').val());
            });

            jQuery('#bodyContent_rbtnCodeRestrictRestrictBy').click(function () {
                jQuery('#bodyContent_CodeRestrictRelatedDiv').hide();
                jQuery('#bodyContent_CodeRestrictTimeIntervalDiv').hide();
                jQuery('#bodyContent_CodeRestrictRestrictByDiv').show();

                jQuery('#bodyContent_CodeRestrictField1HiddenField').val(jQuery('#bodyContent_ddlCodeRestrictRestrictByFrom').val());
                jQuery('#bodyContent_CodeRestrictField2HiddenField').val(jQuery('#bodyContent_ddlCodeRestrictRestrictByTo').val());
            });

            /* update hidden field value (on click) */
            jQuery('#bodyContent_ddlCodeRestrictRelated').change(function () {
                jQuery('#bodyContent_CodeRestrictField1HiddenField').val(jQuery(this).val());
                jQuery('#bodyContent_CodeRestrictField2HiddenField').val('');
            });

            jQuery('#bodyContent_ddlCodeRestrictRestrictByFrom').change(function () {
                jQuery('#bodyContent_CodeRestrictField1HiddenField').val(jQuery(this).val());
            });

            jQuery('#bodyContent_ddlCodeRestrictRestrictByTo').change(function () {
                jQuery('#bodyContent_CodeRestrictField2HiddenField').val(jQuery(this).val());
            });

            jQuery('#bodyContent_txtCodeRestrictTimeIntervalFrom').datepicker({ format: 'dd/mm/yyyy' }).on('changeDate', function (e) {
                jQuery('#bodyContent_CodeRestrictField1HiddenField').val(e.date.format('dd/mm/yyyy'));
            });

            jQuery('#bodyContent_txtCodeRestrictTimeIntervalTo').datepicker({ format: 'dd/mm/yyyy' }).on('changeDate', function (e) {
                jQuery('#bodyContent_CodeRestrictField2HiddenField').val(e.date.format('dd/mm/yyyy'));
            });

            /* update hidden field value (on load) */
            if (jQuery('#bodyContent_rbtnCodeRestrictRelated').is(':checked')) {
                jQuery('#bodyContent_ddlCodeRestrictRelated').val(jQuery('#bodyContent_CodeRestrictField1HiddenField').val());
            } else if (jQuery('#bodyContent_rbtnCodeRestrictTimeInterval').is(':checked')) {
                jQuery('#bodyContent_txtCodeRestrictTimeIntervalFrom').val(jQuery('#bodyContent_CodeRestrictField1HiddenField').val());
                jQuery('#bodyContent_txtCodeRestrictTimeIntervalTo').val(jQuery('#bodyContent_CodeRestrictField2HiddenField').val());
            } else if (jQuery('#bodyContent_rbtnCodeRestrictRestrictBy').is(':checked')) {
                jQuery('#bodyContent_ddlCodeRestrictRestrictByFrom').val(jQuery('#bodyContent_CodeRestrictField1HiddenField').val());
                jQuery('#bodyContent_ddlCodeRestrictRestrictByTo').val(jQuery('#bodyContent_CodeRestrictField2HiddenField').val());
            }


            /**
            * script for 'Date/Time' tab
            ********************************************************************************/

            /* show/hide logic (on load) */
            jQuery('#bodyContent_TimeDateParameterDiv').hide();
            jQuery('#bodyContent_TimeIntervalDiv').hide();
            jQuery('#bodyContent_RestrictByDiv').hide();

            if (jQuery('#bodyContent_rbtnTimeDateParameter').is(':checked')) {
                jQuery('#bodyContent_TimeDateParameterDiv').show();
            } else if (jQuery('#bodyContent_rbtnTimeInterval').is(':checked')) {
                jQuery('#bodyContent_TimeIntervalDiv').show();
            } else if (jQuery('#bodyContent_rbtnRestrictBy').is(':checked')) {
                jQuery('#bodyContent_RestrictByDiv').show();
            }

            /* show/hide logic (on click) */
            jQuery('#bodyContent_rbtnTimeDateParameter').click(function () {
                jQuery('#bodyContent_TimeDateParameterDiv').show();
                jQuery('#bodyContent_TimeIntervalDiv').hide();
                jQuery('#bodyContent_RestrictByDiv').hide();

                jQuery('#bodyContent_DateField1HiddenField').val(jQuery('#bodyContent_ddlTimeDateParameter').val());
                jQuery('#bodyContent_DateField2HiddenField').val('');
            });

            jQuery('#bodyContent_rbtnTimeInterval').click(function () {
                jQuery('#bodyContent_TimeDateParameterDiv').hide();
                jQuery('#bodyContent_TimeIntervalDiv').show();
                jQuery('#bodyContent_RestrictByDiv').hide();

                jQuery('#bodyContent_DateField1HiddenField').val(jQuery('#bodyContent_txtDateTimeIntervalFrom').val());
                jQuery('#bodyContent_DateField2HiddenField').val(jQuery('#bodyContent_txtDateTimeIntervalTo').val());
            });

            jQuery('#bodyContent_rbtnRestrictBy').click(function () {
                jQuery('#bodyContent_TimeDateParameterDiv').hide();
                jQuery('#bodyContent_TimeIntervalDiv').hide();
                jQuery('#bodyContent_RestrictByDiv').show();

                jQuery('#bodyContent_DateField1HiddenField').val(jQuery('#bodyContent_ddlRestrictByFrom').val());
                jQuery('#bodyContent_DateField2HiddenField').val(jQuery('#bodyContent_ddlRestrictByTo').val());
            });

            /* update hidden field value (on click) */
            jQuery('#bodyContent_ddlTimeDateParameter').change(function () {
                jQuery('#bodyContent_DateField1HiddenField').val(jQuery(this).val());
                jQuery('#bodyContent_DateField2HiddenField').val('');
            });

            jQuery('#bodyContent_ddlRestrictByFrom').change(function () {
                jQuery('#bodyContent_DateField1HiddenField').val(jQuery(this).val());
            });

            jQuery('#bodyContent_ddlRestrictByTo').change(function () {
                jQuery('#bodyContent_DateField2HiddenField').val(jQuery(this).val());
            });

            jQuery('#bodyContent_txtDateTimeIntervalFrom').datepicker({ format: 'dd/mm/yyyy' }).on('changeDate', function (e) {
                jQuery('#bodyContent_DateField1HiddenField').val(e.date.format('dd/mm/yyyy'));
            });

            jQuery('#bodyContent_txtDateTimeIntervalTo').datepicker({ format: 'dd/mm/yyyy' }).on('changeDate', function (e) {
                jQuery('#bodyContent_DateField2HiddenField').val(e.date.format('dd/mm/yyyy'));
            });

            /* update hidden field value (on load) */
            if (jQuery('#bodyContent_rbtnTimeDateParameter').is(':checked')) {
                jQuery('#bodyContent_ddlTimeDateParameter').val(jQuery('#bodyContent_DateField1HiddenField').val());
            } else if (jQuery('#bodyContent_rbtnTimeInterval').is(':checked')) {
                jQuery('#bodyContent_txtDateTimeIntervalFrom').val(jQuery('#bodyContent_DateField1HiddenField').val());
                jQuery('#bodyContent_txtDateTimeIntervalTo').val(jQuery('#bodyContent_DateField2HiddenField').val());
            } else if (jQuery('#bodyContent_rbtnRestrictBy').is(':checked')) {
                jQuery('#bodyContent_ddlRestrictByFrom').val(jQuery('#bodyContent_DateField1HiddenField').val());
                jQuery('#bodyContent_ddlRestrictByTo').val(jQuery('#bodyContent_DateField2HiddenField').val());
            }


            /**
            * script for 'Readings' tab
            ********************************************************************************/

            /* filter table */
            var optionsLaboratory = { additionalFilterTriggers: [jQuery('#bodyContent_txtLaboratoryListQuickFind')] };
            jQuery('#bodyContent_LaboratoryListGridView').tableFilter(optionsLaboratory);
            jQuery('#bodyContent_LaboratoryListGridView .filters').hide();

            var optionsPharmaceuticals = { additionalFilterTriggers: [jQuery('#bodyContent_txtPharmaceuticalsListQuickFind')] };
            jQuery('#bodyContent_PharmaceuticalsListGridView').tableFilter(optionsPharmaceuticals);
            jQuery('#bodyContent_PharmaceuticalsListGridView .filters').hide();

            var optionsMeasurements = { additionalFilterTriggers: [jQuery('#bodyContent_txtMeasurementsListQuickFind')] };
            jQuery('#bodyContent_MeasurementsListGridView').tableFilter(optionsMeasurements);
            jQuery('#bodyContent_MeasurementsListGridView .filters').hide();

            /* show/hide logic (on load) */
            jQuery('#bodyContent_LaboratoryListDiv').hide();
            jQuery('#bodyContent_PharmaceuticalsListDiv').hide();
            jQuery('#bodyContent_MeasurementsListDiv').hide();

            jQuery('#bodyContent_SelectedLaboratory').hide();
            jQuery('#bodyContent_SelectedPharmaceuticals').hide();
            jQuery('#bodyContent_SelectedMeasurements').hide();

            if (jQuery('#bodyContent_rbtnLaboratory').is(':checked')) {
                jQuery('#bodyContent_LaboratoryListDiv').show();
            } else if (jQuery('#bodyContent_rbtnPharmaceuticals').is(':checked')) {
                jQuery('#bodyContent_PharmaceuticalsListDiv').show();
            } else if (jQuery('#bodyContent_rbtnMeasurements').is(':checked')) {
                jQuery('#bodyContent_MeasurementsListDiv').show();
            }

            /* show/hide logic (on click) */
            jQuery('#bodyContent_rbtnLaboratory').click(function () {
                jQuery('#bodyContent_LaboratoryListDiv').show();
                jQuery('#bodyContent_PharmaceuticalsListDiv').hide();
                jQuery('#bodyContent_MeasurementsListDiv').hide();
            });

            jQuery('#bodyContent_rbtnPharmaceuticals').click(function () {
                jQuery('#bodyContent_LaboratoryListDiv').hide();
                jQuery('#bodyContent_PharmaceuticalsListDiv').show();
                jQuery('#bodyContent_MeasurementsListDiv').hide();
            });

            jQuery('#bodyContent_rbtnMeasurements').click(function () {
                jQuery('#bodyContent_LaboratoryListDiv').hide();
                jQuery('#bodyContent_PharmaceuticalsListDiv').hide();
                jQuery('#bodyContent_MeasurementsListDiv').show();
            });

            /* highlight selected code (on load) */
            jQuery('#bodyContent_LaboratoryListGridView tr td input[type=hidden]').each(function () {
                if (jQuery(this).val() == jQuery('#bodyContent_ReadingsIdHiddenField').val()) {
                    jQuery(this).parent().parent().addClass('label label-success');
                }
            });

            jQuery('#bodyContent_PharmaceuticalsListGridView tr td input[type=hidden]').each(function () {
                if (jQuery(this).val() == jQuery('#bodyContent_ReadingsIdHiddenField').val()) {
                    jQuery(this).parent().parent().addClass('label label-success');
                }
            });

            jQuery('#bodyContent_MeasurementsListGridView tr td input[type=hidden]').each(function () {
                if (jQuery(this).val() == jQuery('#bodyContent_ReadingsIdHiddenField').val()) {
                    jQuery(this).parent().parent().addClass('label label-success');
                }
            });

            /* highlight selected code (on click) */
            jQuery('.readings-select-code').click(function () {
                jQuery(this).parent().parent().parent().find('tr').removeClass('label label-success');
                jQuery(this).parent().parent().addClass('label label-success');
                jQuery('#bodyContent_ReadingsIdHiddenField').val(jQuery(this).parent().find('input').val());
                return false;
            });


            /**
            * script for 'Readings Restrict' tab
            ********************************************************************************/

            /* show/hide logic (on load) */
            jQuery('#bodyContent_ReadingsRestrictRelatedDiv').hide();
            jQuery('#bodyContent_ReadingsRestrictTimeIntervalDiv').hide();
            jQuery('#bodyContent_ReadingsRestrictRestrictByDiv').hide();

            if (jQuery('#bodyContent_rbtnReadingsRestrictRelated').is(':checked')) {
                jQuery('#bodyContent_ReadingsRestrictRelatedDiv').show();
            } else if (jQuery('#bodyContent_rbtnReadingsRestrictTimeInterval').is(':checked')) {
                jQuery('#bodyContent_ReadingsRestrictTimeIntervalDiv').show();
            } else if (jQuery('#bodyContent_rbtnReadingsRestrictRestrictBy').is(':checked')) {
                jQuery('#bodyContent_ReadingsRestrictRestrictByDiv').show();
            }

            /* show/hide logic (on click) */
            jQuery('#bodyContent_rbtnReadingsRestrictRelated').click(function () {
                jQuery('#bodyContent_ReadingsRestrictRelatedDiv').show();
                jQuery('#bodyContent_ReadingsRestrictTimeIntervalDiv').hide();
                jQuery('#bodyContent_ReadingsRestrictRestrictByDiv').hide();

                jQuery('#bodyContent_ReadingsRestrictField1HiddenField').val(jQuery('#bodyContent_ddlReadingsRestrictRelated').val());
                jQuery('#bodyContent_ReadingsRestrictField2HiddenField').val('');
            });

            jQuery('#bodyContent_rbtnReadingsRestrictTimeInterval').click(function () {
                jQuery('#bodyContent_ReadingsRestrictRelatedDiv').hide();
                jQuery('#bodyContent_ReadingsRestrictTimeIntervalDiv').show();
                jQuery('#bodyContent_ReadingsRestrictRestrictByDiv').hide();

                jQuery('#bodyContent_ReadingsRestrictField1HiddenField').val(jQuery('#bodyContent_txtReadingsRestrictTimeIntervalFrom').val());
                jQuery('#bodyContent_ReadingsRestrictField2HiddenField').val(jQuery('#bodyContent_txtReadingsRestrictTimeIntervalTo').val());
            });

            jQuery('#bodyContent_rbtnReadingsRestrictRestrictBy').click(function () {
                jQuery('#bodyContent_ReadingsRestrictRelatedDiv').hide();
                jQuery('#bodyContent_ReadingsRestrictTimeIntervalDiv').hide();
                jQuery('#bodyContent_ReadingsRestrictRestrictByDiv').show();

                jQuery('#bodyContent_ReadingsRestrictField1HiddenField').val(jQuery('#bodyContent_ddlReadingsRestrictRestrictByFrom').val());
                jQuery('#bodyContent_ReadingsRestrictField2HiddenField').val(jQuery('#bodyContent_ddlReadingsRestrictRestrictByTo').val());
            });

            /* update hidden field value (on click) */
            jQuery('#bodyContent_ddlReadingsRestrictRelated').change(function () {
                jQuery('#bodyContent_ReadingsRestrictField1HiddenField').val(jQuery(this).val());
                jQuery('#bodyContent_ReadingsRestrictField2HiddenField').val('');
            });

            jQuery('#bodyContent_ddlReadingsRestrictRestrictByFrom').change(function () {
                jQuery('#bodyContent_ReadingsRestrictField1HiddenField').val(jQuery(this).val());
            });

            jQuery('#bodyContent_ddlReadingsRestrictRestrictByTo').change(function () {
                jQuery('#bodyContent_ReadingsRestrictField2HiddenField').val(jQuery(this).val());
            });

            jQuery('#bodyContent_txtReadingsRestrictTimeIntervalFrom').datepicker({ format: 'dd/mm/yyyy' }).on('changeDate', function (e) {
                jQuery('#bodyContent_ReadingsRestrictField1HiddenField').val(e.date.format('dd/mm/yyyy'));
            });

            jQuery('#bodyContent_txtReadingsRestrictTimeIntervalTo').datepicker({ format: 'dd/mm/yyyy' }).on('changeDate', function (e) {
                jQuery('#bodyContent_ReadingsRestrictField2HiddenField').val(e.date.format('dd/mm/yyyy'));
            });

            /* update hidden field value (on load) */
            if (jQuery('#bodyContent_rbtnReadingsRestrictRelated').is(':checked')) {
                jQuery('#bodyContent_ddlReadingsRestrictRelated').val(jQuery('#bodyContent_ReadingsRestrictField1HiddenField').val());
            } else if (jQuery('#bodyContent_rbtnReadingsRestrictTimeInterval').is(':checked')) {
                jQuery('#bodyContent_txtReadingsRestrictTimeIntervalFrom').val(jQuery('#bodyContent_ReadingsRestrictField1HiddenField').val());
                jQuery('#bodyContent_txtReadingsRestrictTimeIntervalTo').val(jQuery('#bodyContent_ReadingsRestrictField2HiddenField').val());
            } else if (jQuery('#bodyContent_rbtnReadingsRestrictRestrictBy').is(':checked')) {
                jQuery('#bodyContent_ddlReadingsRestrictRestrictByFrom').val(jQuery('#bodyContent_ReadingsRestrictField1HiddenField').val());
                jQuery('#bodyContent_ddlReadingsRestrictRestrictByTo').val(jQuery('#bodyContent_ReadingsRestrictField2HiddenField').val());
            }


            /**
            * script for 'Text' tab
            ********************************************************************************/

            /* sub div show/hide logic (on load) */
            jQuery('#bodyContent_Referralsdiv').hide();
            jQuery('#bodyContent_MFTdiv').hide();

            if (jQuery('#bodyContent_rbtnReferrals').is(':checked')) {
                jQuery('#bodyContent_Referralsdiv').show();
            } else if (jQuery('#bodyContent_rbtnMedicalFileText').is(':checked')) {
                jQuery('#bodyContent_MFTdiv').show();
            }

            /* show/hide logic (on click) */
            jQuery('#bodyContent_rbtnReferrals').click(function () {
                jQuery('#bodyContent_Referralsdiv').show();
                jQuery('#bodyContent_MFTdiv').hide();

                jQuery('#bodyContent_TextField1HiddenField').val(jQuery('#bodyContent_ddlReferralsProfession').val());
                jQuery('#bodyContent_TextField2HiddenField').val(jQuery('#bodyContent_ddlReferralsType').val());
                jQuery('#bodyContent_TextField3HiddenField').val(jQuery('#bodyContent_ddlReferralsDepartment').val());
            });

            jQuery('#bodyContent_rbtnMedicalFileText').click(function () {
                jQuery('#bodyContent_Referralsdiv').hide();
                jQuery('#bodyContent_MFTdiv').show();

                jQuery('#bodyContent_TextField1HiddenField').val(jQuery('#bodyContent_ddlMFTProfession').val());
                jQuery('#bodyContent_TextField2HiddenField').val(jQuery('#bodyContent_ddlMFTType').val());
                jQuery('#bodyContent_TextField3HiddenField').val(jQuery('#bodyContent_ddlMFTDepartment').val());
            });

            /* update hidden field value (on click) */
            jQuery('#bodyContent_ddlReferralsProfession, #bodyContent_ddlMFTProfession').change(function () {
                jQuery('#bodyContent_TextField1HiddenField').val(jQuery(this).val());
            });

            jQuery('#bodyContent_ddlReferralsType, #bodyContent_ddlMFTType').change(function () {
                jQuery('#bodyContent_TextField2HiddenField').val(jQuery(this).val());
            });

            jQuery('#bodyContent_ddlReferralsDepartment, #bodyContent_ddlMFTDepartment').change(function () {
                jQuery('#bodyContent_TextField3HiddenField').val(jQuery(this).val());
            });

            /* update hidden field value (on load) */
            if (jQuery('#bodyContent_rbtnReferrals').is(':checked')) {
                jQuery('#bodyContent_ddlReferralsProfession').val(jQuery('#bodyContent_TextField1HiddenField').val());
                jQuery('#bodyContent_ddlReferralsType').val(jQuery('#bodyContent_TextField2HiddenField').val());
                jQuery('#bodyContent_ddlReferralsDepartment').val(jQuery('#bodyContent_TextField3HiddenField').val());
            } else if (jQuery('#bodyContent_rbtnMedicalFileText').is(':checked')) {
                jQuery('#bodyContent_ddlMFTProfession').val(jQuery('#bodyContent_TextField1HiddenField').val());
                jQuery('#bodyContent_ddlMFTType').val(jQuery('#bodyContent_TextField2HiddenField').val());
                jQuery('#bodyContent_ddlMFTDepartment').val(jQuery('#bodyContent_TextField3HiddenField').val());
            }


            /**
            * script for 'Text Restrict' tab
            ********************************************************************************/

            /* show/hide logic (on load) */
            jQuery('#bodyContent_TextRestrictRelatedDiv').hide();
            jQuery('#bodyContent_TextRestrictTimeIntervalDiv').hide();
            jQuery('#bodyContent_TextRestrictRestrictByDiv').hide();

            if (jQuery('#bodyContent_rbtnTextRestrictRelated').is(':checked')) {
                jQuery('#bodyContent_TextRestrictRelatedDiv').show();
            } else if (jQuery('#bodyContent_rbtnTextRestrictTimeInterval').is(':checked')) {
                jQuery('#bodyContent_TextRestrictTimeIntervalDiv').show();
            } else if (jQuery('#bodyContent_rbtnTextRestrictRestrictBy').is(':checked')) {
                jQuery('#bodyContent_TextRestrictRestrictByDiv').show();
            }

            /* show/hide logic (on click) */
            jQuery('#bodyContent_rbtnTextRestrictRelated').click(function () {
                jQuery('#bodyContent_TextRestrictRelatedDiv').show();
                jQuery('#bodyContent_TextRestrictTimeIntervalDiv').hide();
                jQuery('#bodyContent_TextRestrictRestrictByDiv').hide();

                jQuery('#bodyContent_TextRestrictField1HiddenField').val(jQuery('#bodyContent_ddlTextRestrictRelated').val());
                jQuery('#bodyContent_TextRestrictField2HiddenField').val('');
            });

            jQuery('#bodyContent_rbtnTextRestrictTimeInterval').click(function () {
                jQuery('#bodyContent_TextRestrictRelatedDiv').hide();
                jQuery('#bodyContent_TextRestrictTimeIntervalDiv').show();
                jQuery('#bodyContent_TextRestrictRestrictByDiv').hide();

                jQuery('#bodyContent_TextRestrictField1HiddenField').val(jQuery('#bodyContent_txtTextRestrictTimeIntervalFrom').val());
                jQuery('#bodyContent_TextRestrictField2HiddenField').val(jQuery('#bodyContent_txtTextRestrictTimeIntervalTo').val());
            });

            jQuery('#bodyContent_rbtnTextRestrictRestrictBy').click(function () {
                jQuery('#bodyContent_TextRestrictRelatedDiv').hide();
                jQuery('#bodyContent_TextRestrictTimeIntervalDiv').hide();
                jQuery('#bodyContent_TextRestrictRestrictByDiv').show();

                jQuery('#bodyContent_TextRestrictField1HiddenField').val(jQuery('#bodyContent_ddlTextRestrictRestrictByFrom').val());
                jQuery('#bodyContent_TextRestrictField2HiddenField').val(jQuery('#bodyContent_ddlTextRestrictRestrictByTo').val());
            });

            /* update hidden field value (on click) */
            jQuery('#bodyContent_ddlTextRestrictRelated').change(function () {
                jQuery('#bodyContent_TextRestrictField1HiddenField').val(jQuery(this).val());
                jQuery('#bodyContent_TextRestrictField2HiddenField').val('');
            });

            jQuery('#bodyContent_ddlTextRestrictRestrictByFrom').change(function () {
                jQuery('#bodyContent_TextRestrictField1HiddenField').val(jQuery(this).val());
            });

            jQuery('#bodyContent_ddlTextRestrictRestrictByTo').change(function () {
                jQuery('#bodyContent_TextRestrictField2HiddenField').val(jQuery(this).val());
            });

            jQuery('#bodyContent_txtTextRestrictTimeIntervalFrom').datepicker({ format: 'dd/mm/yyyy' }).on('changeDate', function (e) {
                jQuery('#bodyContent_TextRestrictField1HiddenField').val(e.date.format('dd/mm/yyyy'));
            });

            jQuery('#bodyContent_txtTextRestrictTimeIntervalTo').datepicker({ format: 'dd/mm/yyyy' }).on('changeDate', function (e) {
                jQuery('#bodyContent_TextRestrictField2HiddenField').val(e.date.format('dd/mm/yyyy'));
            });

            /* update hidden field value (on load) */
            if (jQuery('#bodyContent_rbtnTextRestrictRelated').is(':checked')) {
                jQuery('#bodyContent_ddlTextRestrictRelated').val(jQuery('#bodyContent_TextRestrictField1HiddenField').val());
            } else if (jQuery('#bodyContent_rbtnTextRestrictTimeInterval').is(':checked')) {
                jQuery('#bodyContent_txtTextRestrictTimeIntervalFrom').val(jQuery('#bodyContent_TextRestrictField1HiddenField').val());
                jQuery('#bodyContent_txtTextRestrictTimeIntervalTo').val(jQuery('#bodyContent_TextRestrictField2HiddenField').val());
            } else if (jQuery('#bodyContent_rbtnTextRestrictRestrictBy').is(':checked')) {
                jQuery('#bodyContent_ddlTextRestrictRestrictByFrom').val(jQuery('#bodyContent_TextRestrictField1HiddenField').val());
                jQuery('#bodyContent_ddlTextRestrictRestrictByTo').val(jQuery('#bodyContent_TextRestrictField2HiddenField').val());
            }


            /**
            * script for 'Radiology' tab
            ********************************************************************************/

            /* filter table */
            var optionsMRI = { additionalFilterTriggers: [jQuery('#bodyContent_txtMRIListQuickFind')] };
            jQuery('#bodyContent_MRIListGridView').tableFilter(optionsMRI);
            jQuery('#bodyContent_MRIListGridView .filters').hide();

            var optionsCT = { additionalFilterTriggers: [jQuery('#bodyContent_txtCTListQuickFind')] };
            jQuery('#bodyContent_CTListGridView').tableFilter(optionsCT);
            jQuery('#bodyContent_CTListGridView .filters').hide();

            var optionsXRay = { additionalFilterTriggers: [jQuery('#bodyContent_txtXRayListQuickFind')] };
            jQuery('#bodyContent_XRayListGridView').tableFilter(optionsXRay);
            jQuery('#bodyContent_XRayListGridView .filters').hide();

            var optionsUSG = { additionalFilterTriggers: [jQuery('#bodyContent_txtUSGListQuickFind')] };
            jQuery('#bodyContent_USGListGridView').tableFilter(optionsUSG);
            jQuery('#bodyContent_USGListGridView .filters').hide();


            /* show/hide logic (on load) */
            jQuery('#bodyContent_MRIListDiv').hide();
            jQuery('#bodyContent_CTListDiv').hide();
            jQuery('#bodyContent_XRayListDiv').hide();
            jQuery('#bodyContent_USGListDiv').hide();

            if (jQuery('#bodyContent_rbtnMRI').is(':checked')) {
                jQuery('#bodyContent_MRIListDiv').show();
            } else if (jQuery('#bodyContent_rbtnCT').is(':checked')) {
                jQuery('#bodyContent_CTListDiv').show();
            } else if (jQuery('#bodyContent_rbtnXRay').is(':checked')) {
                jQuery('#bodyContent_XRayListDiv').show();
            } else if (jQuery('#bodyContent_rbtnUSG').is(':checked')) {
                jQuery('#bodyContent_USGListDiv').show();
            }

            /* show/hide logic (on click) */
            jQuery('#bodyContent_rbtnMRI').click(function () {
                jQuery('#bodyContent_MRIListDiv').show();
                jQuery('#bodyContent_CTListDiv').hide();
                jQuery('#bodyContent_XRayListDiv').hide();
                jQuery('#bodyContent_USGListDiv').hide();
            });

            jQuery('#bodyContent_rbtnCT').click(function () {
                jQuery('#bodyContent_MRIListDiv').hide();
                jQuery('#bodyContent_CTListDiv').show();
                jQuery('#bodyContent_XRayListDiv').hide();
                jQuery('#bodyContent_USGListDiv').hide();
            });

            jQuery('#bodyContent_rbtnXRay').click(function () {
                jQuery('#bodyContent_MRIListDiv').hide();
                jQuery('#bodyContent_CTListDiv').hide();
                jQuery('#bodyContent_XRayListDiv').show();
                jQuery('#bodyContent_USGListDiv').hide();
            });

            jQuery('#bodyContent_rbtnUSG').click(function () {
                jQuery('#bodyContent_MRIListDiv').hide();
                jQuery('#bodyContent_CTListDiv').hide();
                jQuery('#bodyContent_XRayListDiv').hide();
                jQuery('#bodyContent_USGListDiv').show();
            });

            /* highlight selected code (on load) */
            jQuery('#bodyContent_MRIListGridView tr td input[type=hidden]').each(function () {
                if (jQuery(this).val() == jQuery('#bodyContent_RadiologyIdHiddenField').val()) {
                    jQuery(this).parent().parent().addClass('label label-success');
                }
            });

            jQuery('#bodyContent_CTListGridView tr td input[type=hidden]').each(function () {
                if (jQuery(this).val() == jQuery('#bodyContent_RadiologyIdHiddenField').val()) {
                    jQuery(this).parent().parent().addClass('label label-success');
                }
            });

            jQuery('#bodyContent_XRayListGridView tr td input[type=hidden]').each(function () {
                if (jQuery(this).val() == jQuery('#bodyContent_RadiologyIdHiddenField').val()) {
                    jQuery(this).parent().parent().addClass('label label-success');
                }
            });

            jQuery('#bodyContent_USGListGridView tr td input[type=hidden]').each(function () {
                if (jQuery(this).val() == jQuery('#bodyContent_RadiologyIdHiddenField').val()) {
                    jQuery(this).parent().parent().addClass('label label-success');
                }
            });

            /* highlight selected code (on click) */
            jQuery('.radiology-select-code').click(function () {
                jQuery(this).parent().parent().parent().find('tr').removeClass('label label-success');
                jQuery(this).parent().parent().addClass('label label-success');
                jQuery('#bodyContent_RadiologyIdHiddenField').val(jQuery(this).parent().find('input').val());
                return false;
            });


            /**
            * script for 'Radiology Restrict' tab
            ********************************************************************************/

            /* show/hide logic (on load) */
            jQuery('#bodyContent_RadiologyRestrictRelatedDiv').hide();
            jQuery('#bodyContent_RadiologyRestrictTimeIntervalDiv').hide();
            jQuery('#bodyContent_RadiologyRestrictRestrictByDiv').hide();

            if (jQuery('#bodyContent_rbtnRadiologyRestrictRelated').is(':checked')) {
                jQuery('#bodyContent_RadiologyRestrictRelatedDiv').show();
            } else if (jQuery('#bodyContent_rbtnRadiologyRestrictTimeInterval').is(':checked')) {
                jQuery('#bodyContent_RadiologyRestrictTimeIntervalDiv').show();
            } else if (jQuery('#bodyContent_rbtnRadiologyRestrictRestrictBy').is(':checked')) {
                jQuery('#bodyContent_RadiologyRestrictRestrictByDiv').show();
            }

            /* show/hide logic (on click) */
            jQuery('#bodyContent_rbtnRadiologyRestrictRelated').click(function () {
                jQuery('#bodyContent_RadiologyRestrictRelatedDiv').show();
                jQuery('#bodyContent_RadiologyRestrictTimeIntervalDiv').hide();
                jQuery('#bodyContent_RadiologyRestrictRestrictByDiv').hide();

                jQuery('#bodyContent_RadiologyRestrictField1HiddenField').val(jQuery('#bodyContent_ddlRadiologyRestrictRelated').val());
                jQuery('#bodyContent_RadiologyRestrictField2HiddenField').val('');
            });

            jQuery('#bodyContent_rbtnRadiologyRestrictTimeInterval').click(function () {
                jQuery('#bodyContent_RadiologyRestrictRelatedDiv').hide();
                jQuery('#bodyContent_RadiologyRestrictTimeIntervalDiv').show();
                jQuery('#bodyContent_RadiologyRestrictRestrictByDiv').hide();

                jQuery('#bodyContent_RadiologyRestrictField1HiddenField').val(jQuery('#bodyContent_txtRadiologyRestrictTimeIntervalFrom').val());
                jQuery('#bodyContent_RadiologyRestrictField2HiddenField').val(jQuery('#bodyContent_txtRadiologyRestrictTimeIntervalTo').val());
            });

            jQuery('#bodyContent_rbtnRadiologyRestrictRestrictBy').click(function () {
                jQuery('#bodyContent_RadiologyRestrictRelatedDiv').hide();
                jQuery('#bodyContent_RadiologyRestrictTimeIntervalDiv').hide();
                jQuery('#bodyContent_RadiologyRestrictRestrictByDiv').show();

                jQuery('#bodyContent_RadiologyRestrictField1HiddenField').val(jQuery('#bodyContent_ddlRadiologyRestrictRestrictByFrom').val());
                jQuery('#bodyContent_RadiologyRestrictField2HiddenField').val(jQuery('#bodyContent_ddlRadiologyRestrictRestrictByTo').val());
            });

            /* update hidden field value (on click) */
            jQuery('#bodyContent_ddlRadiologyRestrictRelated').change(function () {
                jQuery('#bodyContent_RadiologyRestrictField1HiddenField').val(jQuery(this).val());
                jQuery('#bodyContent_RadiologyRestrictField2HiddenField').val('');
            });

            jQuery('#bodyContent_ddlRadiologyRestrictRestrictByFrom').change(function () {
                jQuery('#bodyContent_RadiologyRestrictField1HiddenField').val(jQuery(this).val());
            });

            jQuery('#bodyContent_ddlRadiologyRestrictRestrictByTo').change(function () {
                jQuery('#bodyContent_RadiologyRestrictField2HiddenField').val(jQuery(this).val());
            });

            jQuery('#bodyContent_txtRadiologyRestrictTimeIntervalFrom').datepicker({ format: 'dd/mm/yyyy' }).on('changeDate', function (e) {
                jQuery('#bodyContent_RadiologyRestrictField1HiddenField').val(e.date.format('dd/mm/yyyy'));
            });

            jQuery('#bodyContent_txtRadiologyRestrictTimeIntervalTo').datepicker({ format: 'dd/mm/yyyy' }).on('changeDate', function (e) {
                jQuery('#bodyContent_RadiologyRestrictField2HiddenField').val(e.date.format('dd/mm/yyyy'));
            });

            /* update hidden field value (on load) */
            if (jQuery('#bodyContent_rbtnRadiologyRestrictRelated').is(':checked')) {
                jQuery('#bodyContent_ddlRadiologyRestrictRelated').val(jQuery('#bodyContent_RadiologyRestrictField1HiddenField').val());
            } else if (jQuery('#bodyContent_rbtnRadiologyRestrictTimeInterval').is(':checked')) {
                jQuery('#bodyContent_txtRadiologyRestrictTimeIntervalFrom').val(jQuery('#bodyContent_RadiologyRestrictField1HiddenField').val());
                jQuery('#bodyContent_txtRadiologyRestrictTimeIntervalTo').val(jQuery('#bodyContent_RadiologyRestrictField2HiddenField').val());
            } else if (jQuery('#bodyContent_rbtnRadiologyRestrictRestrictBy').is(':checked')) {
                jQuery('#bodyContent_ddlRadiologyRestrictRestrictByFrom').val(jQuery('#bodyContent_RadiologyRestrictField1HiddenField').val());
                jQuery('#bodyContent_ddlRadiologyRestrictRestrictByTo').val(jQuery('#bodyContent_RadiologyRestrictField2HiddenField').val());
            }


            /**
            * script for 'SNOMED-CT' tab
            ********************************************************************************/

            /* filter table */
            var optionsSnomedCt = { additionalFilterTriggers: [jQuery('#bodyContent_txtSnomedCtListQuickFind')] };
            jQuery('#bodyContent_SnomedCtGridView').tableFilter(optionsSnomedCt);
            jQuery('#bodyContent_SnomedCtGridView .filters').hide();

            /* show/hide logic (on load) */
            jQuery('#bodyContent_SnomedCtListDiv').hide();

            if (jQuery('#bodyContent_rbtnSnomedCt').is(':checked')) {
                jQuery('#bodyContent_SnomedCtListDiv').show();
            }

            /* show/hide logic (on click) */
            jQuery('#bodyContent_rbtnSnomedCt').click(function () {
                jQuery('#bodyContent_SnomedCtListDiv').show();
            });


            /* highlight selected code (on load) */
            jQuery('#bodyContent_SnomedCtGridView tr td input[type=hidden]').each(function () {
                if (jQuery(this).val() == jQuery('#bodyContent_SnomedCtIdHiddenField').val()) {
                    jQuery(this).parent().parent().addClass('label label-success');
                }
            });

            /* highlight selected code (on click) */
            jQuery('.select-snomedct-code').click(function () {
                jQuery(this).parent().parent().parent().find('tr').removeClass('label label-success');
                jQuery(this).parent().parent().addClass('label label-success');
                jQuery('#bodyContent_SnomedCtIdHiddenField').val(jQuery(this).parent().find('input').val());
                return false;
            });


            /**
            * script for 'SnomedCt Restrict' tab
            ********************************************************************************/

            /* show/hide logic (on load) */
            jQuery('#bodyContent_SnomedCtRestrictRelatedDiv').hide();
            jQuery('#bodyContent_SnomedCtRestrictTimeIntervalDiv').hide();
            jQuery('#bodyContent_SnomedCtRestrictRestrictByDiv').hide();

            if (jQuery('#bodyContent_rbtnSnomedCtRestrictRelated').is(':checked')) {
                jQuery('#bodyContent_SnomedCtRestrictRelatedDiv').show();
            } else if (jQuery('#bodyContent_rbtnSnomedCtRestrictTimeInterval').is(':checked')) {
                jQuery('#bodyContent_SnomedCtRestrictTimeIntervalDiv').show();
            } else if (jQuery('#bodyContent_rbtnSnomedCtRestrictRestrictBy').is(':checked')) {
                jQuery('#bodyContent_SnomedCtRestrictRestrictByDiv').show();
            }

            /* show/hide logic (on click) */
            jQuery('#bodyContent_rbtnSnomedCtRestrictRelated').click(function () {
                jQuery('#bodyContent_SnomedCtRestrictRelatedDiv').show();
                jQuery('#bodyContent_SnomedCtRestrictTimeIntervalDiv').hide();
                jQuery('#bodyContent_SnomedCtRestrictRestrictByDiv').hide();

                jQuery('#bodyContent_SnomedCtField1HiddenField').val(jQuery('#bodyContent_ddlSnomedCtRestrictRelated').val());
                jQuery('#bodyContent_SnomedCtField2HiddenField').val('');
            });

            jQuery('#bodyContent_rbtnSnomedCtRestrictTimeInterval').click(function () {
                jQuery('#bodyContent_SnomedCtRestrictRelatedDiv').hide();
                jQuery('#bodyContent_SnomedCtRestrictTimeIntervalDiv').show();
                jQuery('#bodyContent_SnomedCtRestrictRestrictByDiv').hide();

                jQuery('#bodyContent_SnomedCtField1HiddenField').val(jQuery('#bodyContent_txtSnomedCtRestrictTimeIntervalFrom').val());
                jQuery('#bodyContent_SnomedCtField2HiddenField').val(jQuery('#bodyContent_txtSnomedCtRestrictTimeIntervalTo').val());
            });

            jQuery('#bodyContent_rbtnSnomedCtRestrictRestrictBy').click(function () {
                jQuery('#bodyContent_SnomedCtRestrictRelatedDiv').hide();
                jQuery('#bodyContent_SnomedCtRestrictTimeIntervalDiv').hide();
                jQuery('#bodyContent_SnomedCtRestrictRestrictByDiv').show();

                jQuery('#bodyContent_SnomedCtField1HiddenField').val(jQuery('#bodyContent_ddlSnomedCtRestrictRestrictByFrom').val());
                jQuery('#bodyContent_SnomedCtField2HiddenField').val(jQuery('#bodyContent_ddlSnomedCtRestrictRestrictByTo').val());
            });

            /* update hidden field value (on click) */
            jQuery('#bodyContent_ddlSnomedCtRestrictRelated').change(function () {
                jQuery('#bodyContent_SnomedCtField1HiddenField').val(jQuery(this).val());
                jQuery('#bodyContent_SnomedCtField2HiddenField').val('');
            });

            jQuery('#bodyContent_ddlSnomedCtRestrictRestrictByFrom').change(function () {
                jQuery('#bodyContent_SnomedCtField1HiddenField').val(jQuery(this).val());
            });

            jQuery('#bodyContent_ddlSnomedCtRestrictRestrictByTo').change(function () {
                jQuery('#bodyContent_SnomedCtField2HiddenField').val(jQuery(this).val());
            });

            jQuery('#bodyContent_txtSnomedCtRestrictTimeIntervalFrom').datepicker({ format: 'dd/mm/yyyy' }).on('changeDate', function (e) {
                jQuery('#bodyContent_SnomedCtField1HiddenField').val(e.date.format('dd/mm/yyyy'));
            });

            jQuery('#bodyContent_txtSnomedCtRestrictTimeIntervalTo').datepicker({ format: 'dd/mm/yyyy' }).on('changeDate', function (e) {
                jQuery('#bodyContent_SnomedCtField2HiddenField').val(e.date.format('dd/mm/yyyy'));
            });

            /* update hidden field value (on load) */
            if (jQuery('#bodyContent_rbtnSnomedCtRestrictRelated').is(':checked')) {
                jQuery('#bodyContent_ddlSnomedCtRestrictRelated').val(jQuery('#bodyContent_SnomedCtField1HiddenField').val());
            } else if (jQuery('#bodyContent_rbtnSnomedCtRestrictTimeInterval').is(':checked')) {
                jQuery('#bodyContent_txtSnomedCtRestrictTimeIntervalFrom').val(jQuery('#bodyContent_SnomedCtField1HiddenField').val());
                jQuery('#bodyContent_txtSnomedCtRestrictTimeIntervalTo').val(jQuery('#bodyContent_SnomedCtField2HiddenField').val());
            } else if (jQuery('#bodyContent_rbtnSnomedCtRestrictRestrictBy').is(':checked')) {
                jQuery('#bodyContent_ddlSnomedCtRestrictRestrictByFrom').val(jQuery('#bodyContent_SnomedCtField1HiddenField').val());
                jQuery('#bodyContent_ddlSnomedCtRestrictRestrictByTo').val(jQuery('#bodyContent_SnomedCtField2HiddenField').val());
            }

        });

        function SetupBackNNextButton() {

            var currTab = jQuery('#bodyContent_CurrentTabHiddenField').val();
            var firstTab = jQuery('#OutcomeTabs a[data-toggle="tab"]:first').attr('href');
            var lastTab = jQuery('#OutcomeTabs a[data-toggle="tab"]:last').attr('href');

            jQuery('#BackTab').removeAttr('disabled');
            jQuery('#NextTab').removeAttr('disabled');

            if (currTab == '' || currTab == '0') {
                jQuery('#BackTab').attr('disabled', 'disabled');
            }

            if ("#" + currTab.toUpperCase() == firstTab.toUpperCase()) {
                jQuery('#BackTab').attr('disabled', 'disabled');
            }

            if ("#" + currTab.toUpperCase() == lastTab.toUpperCase()) {
                jQuery('#NextTab').attr('disabled', 'disabled');
            }
        }

    </script>

</asp:Content>


<asp:Content ID="Content2" ContentPlaceHolderID="bodyContent" runat="server">


    <div class="navbar"><div class="navbar-inner">
    <div class="container">
        
        <a class="brand" href="./Index.aspx">Re-SeSS</a>
        
        <ul class="nav">
            <li><a href="UserDashboard.aspx">Dashboard</a></li>
            <li class="active"><a href="NewStudy.aspx">New Study</a></li>
            <li><a href="PreviousStudies.aspx">Previous Studies</a></li>
        </ul>

        <ul class="nav pull-right">
            <li class="dropdown">
                <a data-toggle="dropdown" class="dropdown-toggle" href="#"><%=loggedInUserDTO.FirstName%>&nbsp;<%=loggedInUserDTO.LastName%> <b class="caret"></b></a>
                <ul class="dropdown-menu">
                    <li><a href="Profile.aspx">Profile</a></li>
                    <li><a href="ChangePassword.aspx">Change Password</a></li>
                    <li class="divider"></li>
                    <li><a href="LogOut.aspx">Logout</a></li></li>
                </ul>
            </li>
        </ul>
        
    </div>
    </div></div><!--navbar ends-->


    <ul class="breadcrumb">
    	<li class="active">You are in:&nbsp;&nbsp;&nbsp;</li>
    	<li><a href="UserDashboard.aspx">Dashboard</a> <span class="divider">/</span></li>
        <li><a href="NewStudy.aspx">New Study</a> <span class="divider">/</span></li>
        <li><a href="Outcomes.aspx">Outcomes</a> <span class="divider">/</span></li>
        <li class="active">Outcome Details</li>
    </ul><!--breadcrumb ends-->


    <div class="well">

        <h2 id="EditOutcomeHeading" runat="server">Editing Outcome</h2><br />

        <div class="alert alert-error" id="AlertError" runat="server"></div>
        <div class="alert alert-success" id="AlertSuccess" runat="server"></div>
    	<div class="alert alert-info" id="AlertInfo" runat="server"></div>


        <ul id="OutcomeTabs" class="nav nav-tabs">
            <li class="dropdown active">
                <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                    Code
                    <b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                    <li class="active"><a data-toggle="tab" href="#tabs-code-specify">Specify Parameter</a></li>
                    <li><a data-toggle="tab" href="#tabs-code-restrict">Restrict Search</a></li>
                </ul>
            </li>
            <li><a data-toggle="tab" href="#tabs-datetime">Date/Time</a></li>
            <li class="dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                    Readings
                    <b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                    <li><a data-toggle="tab" href="#tabs-readings-specify">Specify Parameter</a></li>
                    <li><a data-toggle="tab" href="#tabs-readings-restrict">Restrict Search</a></li>
                </ul>
            </li>
            <li class="dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                    Text
                    <b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                    <li><a data-toggle="tab" href="#tabs-text-specify">Specify Parameter</a></li>
                    <li><a data-toggle="tab" href="#tabs-text-restrict">Restrict Search</a></li>
                </ul>
            </li>
            <li class="dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                    Radiology
                    <b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                    <li><a data-toggle="tab" href="#tabs-radiology-specify">Specify Parameter</a></li>
                    <li><a data-toggle="tab" href="#tabs-radiology-restrict">Restrict Search</a></li>
                </ul>
            </li>
            <li class="dropdown">
                <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                    SNOMED-CT
                    <b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                    <li><a data-toggle="tab" href="#tabs-snomed-ct-specify">Specify Parameter</a></li>
                    <li><a data-toggle="tab" href="#tabs-snomed-ct-restrict">Restrict Search</a></li>
                </ul>
            </li>
        </ul>


        <div class="tab-content">

        <div id="tabs-code-specify" class="tab-pane active in">

            <div id="CodeRadioSetDiv" class="span3">
                <p><asp:RadioButton ID="rbtnICD10Code" Text="ICD 10 Codes" GroupName="CodeNumber" runat="server" /></p>
                <p><asp:RadioButton ID="rbtnICD9Code" Text="ICD 9 Codes" GroupName="CodeNumber" runat="server" /></p>
                <p><asp:RadioButton ID="rbtnICD8Code" Text="ICD 8 Codes" GroupName="CodeNumber" runat="server" /></p>
                <p><asp:RadioButton ID="rbtnAGKCode" Text="AGK Codes" GroupName="CodeNumber" runat="server" /></p>
            </div>

            <div id="CodeListContainer" class="span7">
                
                <asp:HiddenField ID="CodeIdHiddenField" runat="server" />
                
                <div id="ICD10ListDiv" runat="server">

                    <asp:TextBox ID="txtICD10ListQuickFind" runat="server" placeholder="Type keywords to filter codes"></asp:TextBox>
                    <asp:GridView ID="ICD10ListGridView" runat="server" AutoGenerateColumns="False"
                        GridLines="None" CellSpacing="-1" 
                        CssClass="table table-bordered" 
                        onprerender="ICD10ListGridView_PreRender">
                        <Columns>
                            <asp:BoundField DataField="Name" HeaderText="Code" />
                            <asp:BoundField DataField="Description" HeaderText="Description" />
                            <asp:TemplateField>
                                <itemtemplate>
                                    <asp:HiddenField ID="CodeIdHiddenField" Value='<%#Eval("Id") %>' runat="server" />
                                    <a href="#" class="btn select-code" title="Select this code"><i class="icon-ok"></i></a>
                                </itemtemplate>
                                <ItemStyle CssClass="center" />
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>

                </div>
                    
                <div id="ICD9ListDiv" runat="server">

                    <asp:TextBox ID="txtICD9ListQuickFind" runat="server" placeholder="Type keywords to filter codes"></asp:TextBox>
                    <asp:GridView ID="ICD9ListGridView" runat="server" AutoGenerateColumns="False"
                        GridLines="None" CellSpacing="-1" 
                        CssClass="table table-bordered" 
                        onprerender="ICD9ListGridView_PreRender">
                        <Columns>
                            <asp:BoundField DataField="Name" HeaderText="Code" />
                            <asp:BoundField DataField="Description" HeaderText="Description" />
                            <asp:TemplateField>
                                <itemtemplate>
                                    <asp:HiddenField ID="CodeIdHiddenField" Value='<%#Eval("Id") %>' runat="server" />
                                    <a href="#" class="btn select-code" title="Select this code"><i class="icon-ok"></i></a>
                                </itemtemplate>
                                <ItemStyle CssClass="center" />
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>

                </div>
                    
                <div id="ICD8ListDiv" runat="server">

                    <asp:TextBox ID="txtICD8ListQuickFind" runat="server" placeholder="Type keywords to filter codes"></asp:TextBox>
                    <asp:GridView ID="ICD8ListGridView" runat="server" AutoGenerateColumns="False"
                        GridLines="None" CellSpacing="-1" 
                        CssClass="table table-bordered" 
                        onprerender="ICD8ListGridView_PreRender">
                        <Columns>
                            <asp:BoundField DataField="Name" HeaderText="Code" />
                            <asp:BoundField DataField="Description" HeaderText="Description" />
                            <asp:TemplateField>
                                <itemtemplate>
                                    <asp:HiddenField ID="CodeIdHiddenField" Value='<%#Eval("Id") %>' runat="server" />
                                    <a href="#" class="btn select-code" title="Select this code"><i class="icon-ok"></i></a>
                                </itemtemplate>
                                <ItemStyle CssClass="center" />
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>

                </div>

                <div id="AGKListDiv" runat="server">

                    <asp:TextBox ID="txtAGKListQuickFind" runat="server" placeholder="Type keywords to filter codes"></asp:TextBox>
                    <asp:GridView ID="AGKListGridView" runat="server" AutoGenerateColumns="False"
                        GridLines="None" CellSpacing="-1" 
                        CssClass="table table-bordered" 
                        onprerender="AGKListGridView_PreRender">
                        <Columns>
                            <asp:BoundField DataField="Name" HeaderText="Code" />
                            <asp:BoundField DataField="Description" HeaderText="Description" />
                            <asp:TemplateField>
                                <itemtemplate>
                                    <asp:HiddenField ID="CodeIdHiddenField" Value='<%#Eval("Id") %>' runat="server" />
                                    <a href="#" class="btn select-code" title="Select this code"><i class="icon-ok"></i></a>
                                </itemtemplate>
                                <ItemStyle CssClass="center" />
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>

                </div>


            </div>

        </div><!-- tabs-code-specify ends -->

        <div id="tabs-code-restrict" class="tab-pane">

            <div id="CodeRestrictRadioSetDiv" class="span3">
                <p><asp:RadioButton ID="rbtnCodeRestrictRelated" Text="Related To" GroupName="CodeRestrictRadioGroup" runat="server" /></p>
                <p><asp:RadioButton ID="rbtnCodeRestrictRestrictBy" Text="Restrict By" GroupName="CodeRestrictRadioGroup" runat="server" /></p>
                <p><asp:RadioButton ID="rbtnCodeRestrictTimeInterval" Text="Time Interval" GroupName="CodeRestrictRadioGroup" runat="server" /></p>
            </div>

            <div id="CodeRestrictListContainer" class="span7">
                    
                <asp:HiddenField ID="CodeRestrictField1HiddenField" runat="server" />
                <asp:HiddenField ID="CodeRestrictField2HiddenField" runat="server" />

                <div id="CodeRestrictRelatedDiv" runat="server">
                    <asp:DropDownList ID="ddlCodeRestrictRelated" runat="server"></asp:DropDownList>
                </div>

                <div id="CodeRestrictRestrictByDiv" runat="server">
                    <asp:DropDownList ID="ddlCodeRestrictRestrictByFrom" runat="server"></asp:DropDownList>&nbsp;&nbsp;&nbsp;
                    <asp:DropDownList ID="ddlCodeRestrictRestrictByTo" runat="server"></asp:DropDownList>
                </div>

                <div id="CodeRestrictTimeIntervalDiv" runat="server">
                    <table border="0" cellpadding="0" cellspacing="0"><tr>
                        <td><div class="form-horizontal"><div class="input-append datepicker">
                            <asp:TextBox ID="txtCodeRestrictTimeIntervalFrom" runat="server" data-date-format="dd/mm/yyyy" CssClass="input-small"></asp:TextBox><span class="add-on"><i class="icon-calendar"></i></span>
                        </div></div></td>
                        <td>&nbsp;&nbsp;to&nbsp;&nbsp;</td>
                        <td><div class="form-horizontal"><div class="input-append datepicker">
                            <asp:TextBox ID="txtCodeRestrictTimeIntervalTo" runat="server" data-date-format="dd/mm/yyyy" CssClass="input-small"></asp:TextBox><span class="add-on"><i class="icon-calendar"></i></span>
                        </div></div></td>
                    </tr></table>
                </div>

            </div>

        </div><!-- tabs-code-restrict ends -->

        <div id="tabs-datetime" class="tab-pane">

            <div id="DateTimeRadioSetDiv" class="span3">
                <p><asp:RadioButton ID="rbtnTimeDateParameter" Text="Time / Date for Parameter" GroupName="DateTime" runat="server" /></p>
                <p><asp:RadioButton ID="rbtnRestrictBy" Text="Restrict By" GroupName="DateTime" runat="server" /></p>
                <p><asp:RadioButton ID="rbtnTimeInterval" Text="Time Interval" GroupName="DateTime" runat="server" /></p>
            </div>

            <div id="DateTimeContainerDiv" class="span7">
                    
                <asp:HiddenField ID="DateField1HiddenField" runat="server" />
                <asp:HiddenField ID="DateField2HiddenField" runat="server" />

                <div id="TimeDateParameterDiv" runat="server">
                    <asp:DropDownList ID="ddlTimeDateParameter" runat="server"></asp:DropDownList>
                </div>

                <div id="RestrictByDiv" runat="server">
                    <asp:DropDownList ID="ddlRestrictByFrom" runat="server"></asp:DropDownList>&nbsp;&nbsp;&nbsp;
                    <asp:DropDownList ID="ddlRestrictByTo" runat="server"></asp:DropDownList>
                </div>

                <div id="TimeIntervalDiv" runat="server">
                    <table border="0" cellpadding="0" cellspacing="0"><tr>
                        <td><div class="form-horizontal"><div class="input-append datepicker">
                            <asp:TextBox ID="txtDateTimeIntervalFrom" runat="server" data-date-format="dd/mm/yyyy" CssClass="input-small"></asp:TextBox><span class="add-on"><i class="icon-calendar"></i></span>
                        </div></div></td>
                        <td>&nbsp;&nbsp;to&nbsp;&nbsp;</td>
                        <td><div class="form-horizontal"><div class="input-append datepicker">
                            <asp:TextBox ID="txtDateTimeIntervalTo" runat="server" data-date-format="dd/mm/yyyy" CssClass="input-small"></asp:TextBox><span class="add-on"><i class="icon-calendar"></i></span>
                        </div></div></td>
                    </tr></table>
                </div>

            </div>

        </div><!-- tabs-datetime ends -->
            
        <div id="tabs-readings-specify" class="tab-pane">
                
            <div id="ReadingsRadioSetDiv" class="span3">
                <p><asp:RadioButton ID="rbtnLaboratory" Text="Laboratory" GroupName="ReadingsRadioGroup" runat="server" /></p>
                <p><asp:RadioButton ID="rbtnPharmaceuticals" Text="Pharmaceuticals" GroupName="ReadingsRadioGroup" runat="server" /></p>
                <p><asp:RadioButton ID="rbtnMeasurements" Text="Measurements" GroupName="ReadingsRadioGroup" runat="server" /></p>
            </div>

            <div id="ReadingsListContainer" class="span7">
                
                <asp:HiddenField ID="ReadingsIdHiddenField" runat="server" />
                
                <div id="LaboratoryListDiv" runat="server">

                    <asp:TextBox ID="txtLaboratoryListQuickFind" runat="server" placeholder="Type keywords to filter types"></asp:TextBox>
                    <asp:GridView ID="LaboratoryListGridView" runat="server" AutoGenerateColumns="False"
                        GridLines="None" CellSpacing="-1" 
                        CssClass="table table-bordered" 
                        onprerender="LaboratoryListGridView_PreRender">
                        <Columns>
                            <asp:BoundField DataField="Name" HeaderText="Sample" />
                            <asp:BoundField DataField="Description" HeaderText="Description" />
                            <asp:TemplateField>
                                <itemtemplate>
                                    <asp:HiddenField ID="CodeIdHiddenField" Value='<%#Eval("Id") %>' runat="server" />
                                    <a href="#" class="btn readings-select-code" title="Select this code"><i class="icon-ok"></i></a>
                                </itemtemplate>
                                <ItemStyle CssClass="center" />
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>

                </div>
                    
                <div id="PharmaceuticalsListDiv" runat="server">

                    <asp:TextBox ID="txtPharmaceuticalsListQuickFind" runat="server" placeholder="Type keywords to filter Pharmaceuticals table"></asp:TextBox>
                    <asp:GridView ID="PharmaceuticalsListGridView" runat="server" AutoGenerateColumns="False"
                        GridLines="None" CellSpacing="-1" 
                        CssClass="table table-bordered" 
                        onprerender="PharmaceuticalsListGridView_PreRender">
                        <Columns>
                            <asp:BoundField DataField="Name" HeaderText="Preparation Name" />
                            <asp:BoundField DataField="Substance" HeaderText="Substance" />
                            <asp:BoundField DataField="AtnName" HeaderText="ATC Name" />
                            <asp:BoundField DataField="Indication" HeaderText="Indication" />
                            <asp:BoundField DataField="Atc" HeaderText="ATC Code" />
                            <asp:TemplateField>
                                <itemtemplate>
                                    <asp:HiddenField ID="CodeIdHiddenField" Value='<%#Eval("Id") %>' runat="server" />
                                    <a href="#" class="btn readings-select-code" title="Select this code"><i class="icon-ok"></i></a>
                                </itemtemplate>
                                <ItemStyle CssClass="center" />
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>

                </div>
                    
                <div id="MeasurementsListDiv" runat="server">

                    <asp:TextBox ID="txtMeasurementsListQuickFind" runat="server" placeholder="Type keywords to filter codes"></asp:TextBox>
                    <asp:GridView ID="MeasurementsListGridView" runat="server" AutoGenerateColumns="False"
                        GridLines="None" CellSpacing="-1" 
                        CssClass="table table-bordered" 
                        onprerender="MeasurementsListGridView_PreRender">
                        <Columns>
                            <asp:BoundField DataField="Name" HeaderText="Code" />
                            <asp:BoundField DataField="Description" HeaderText="Classification" />
                            <asp:TemplateField>
                                <itemtemplate>
                                    <asp:HiddenField ID="CodeIdHiddenField" Value='<%#Eval("Id") %>' runat="server" />
                                    <a href="#" class="btn readings-select-code" title="Select this code"><i class="icon-ok"></i></a>
                                </itemtemplate>
                                <ItemStyle CssClass="center" />
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>

                </div>

            </div>

        </div><!-- tabs-readings-specify ends -->

        <div id="tabs-readings-restrict" class="tab-pane">

            <div id="ReadingsRestrictRadioSetDiv" class="span3">
                <p><asp:RadioButton ID="rbtnReadingsRestrictRelated" Text="Related To" GroupName="ReadingsRestrictRadioGroup" runat="server" /></p>
                <p><asp:RadioButton ID="rbtnReadingsRestrictRestrictBy" Text="Restrict By" GroupName="ReadingsRestrictRadioGroup" runat="server" /></p>
                <p><asp:RadioButton ID="rbtnReadingsRestrictTimeInterval" Text="Time Interval" GroupName="ReadingsRestrictRadioGroup" runat="server" /></p>
            </div>

            <div id="ReadingsRestrictListContainer" class="span7">
                    
                <asp:HiddenField ID="ReadingsRestrictField1HiddenField" runat="server" />
                <asp:HiddenField ID="ReadingsRestrictField2HiddenField" runat="server" />

                <div id="ReadingsRestrictRelatedDiv" runat="server">
                    <asp:DropDownList ID="ddlReadingsRestrictRelated" runat="server"></asp:DropDownList>
                </div>

                <div id="ReadingsRestrictRestrictByDiv" runat="server">
                    <asp:DropDownList ID="ddlReadingsRestrictRestrictByFrom" runat="server"></asp:DropDownList>&nbsp;&nbsp;&nbsp;
                    <asp:DropDownList ID="ddlReadingsRestrictRestrictByTo" runat="server"></asp:DropDownList>
                </div>

                <div id="ReadingsRestrictTimeIntervalDiv" runat="server">
                    <table border="0" cellpadding="0" cellspacing="0"><tr>
                        <td><div class="form-horizontal"><div class="input-append datepicker">
                            <asp:TextBox ID="txtReadingsRestrictTimeIntervalFrom" runat="server" data-date-format="dd/mm/yyyy" CssClass="input-small"></asp:TextBox><span class="add-on"><i class="icon-calendar"></i></span>
                        </div></div></td>
                        <td>&nbsp;&nbsp;to&nbsp;&nbsp;</td>
                        <td><div class="form-horizontal"><div class="input-append datepicker">
                            <asp:TextBox ID="txtReadingsRestrictTimeIntervalTo" runat="server" data-date-format="dd/mm/yyyy" CssClass="input-small"></asp:TextBox><span class="add-on"><i class="icon-calendar"></i></span>
                        </div></div></td>
                    </tr></table>
                </div>

            </div>

        </div><!-- tabs-readings-restrict ends -->

        <div id="tabs-text-specify" class="tab-pane">
                
            <div id="TextRadioSetDiv" class="span3">
                <p><asp:RadioButton ID="rbtnReferrals" Text="Referrals" GroupName="TextRadios" runat="server" /></p>
                <p><asp:RadioButton ID="rbtnMedicalFileText" Text="Medical File Text" GroupName="TextRadios" runat="server" /></p>
            </div>

            <div id="TextContainerDiv" class="span7">
                    
                <asp:HiddenField ID="TextField1HiddenField" runat="server" />
                <asp:HiddenField ID="TextField2HiddenField" runat="server" />
                <asp:HiddenField ID="TextField3HiddenField" runat="server" />


                <div id="Referralsdiv" runat="server">
                    
                    <asp:Label ID="lblReferralsProfession" runat="server" Text="Profession" AssociatedControlID="ddlReferralsProfession"></asp:Label>
                    <asp:DropDownList ID="ddlReferralsProfession" runat="server">
                    </asp:DropDownList>

                    <asp:Label ID="lblReferralsType" runat="server" Text="Type" AssociatedControlID="ddlReferralsType"></asp:Label>
                    <asp:DropDownList ID="ddlReferralsType" runat="server">
                    </asp:DropDownList>

                    <asp:Label ID="lblReferralsDepartment" runat="server" Text="Department" AssociatedControlID="ddlReferralsDepartment"></asp:Label>
                    <asp:DropDownList ID="ddlReferralsDepartment" runat="server">
                    </asp:DropDownList>
                    
                </div>

                <div id="MFTdiv" runat="server">
                    
                    <asp:Label ID="lblMFTProfession" runat="server" Text="Profession" AssociatedControlID="ddlMFTProfession"></asp:Label>
                    <asp:DropDownList ID="ddlMFTProfession" runat="server">
                    </asp:DropDownList>

                    <asp:Label ID="lblMFTType" runat="server" Text="Type" AssociatedControlID="ddlMFTType"></asp:Label>
                    <asp:DropDownList ID="ddlMFTType" runat="server">
                    </asp:DropDownList>

                    <asp:Label ID="lblMFTDepartment" runat="server" Text="Department" AssociatedControlID="ddlMFTDepartment"></asp:Label>
                    <asp:DropDownList ID="ddlMFTDepartment" runat="server">
                    </asp:DropDownList>
                    
                </div>

            </div>

        </div><!-- tabs-text-specify ends -->

	    <div id="tabs-text-restrict" class="tab-pane">

            <div id="TextRestrictRadioSetDiv" class="span3">
                <p><asp:RadioButton ID="rbtnTextRestrictRelated" Text="Related To" GroupName="TextRestrictRadioGroup" runat="server" /></p>
                <p><asp:RadioButton ID="rbtnTextRestrictRestrictBy" Text="Restrict By" GroupName="TextRestrictRadioGroup" runat="server" /></p>
                <p><asp:RadioButton ID="rbtnTextRestrictTimeInterval" Text="Time Interval" GroupName="TextRestrictRadioGroup" runat="server" /></p>
            </div>

            <div id="TextRestrictListContainer" class="span7">
                    
                <asp:HiddenField ID="TextRestrictField1HiddenField" runat="server" />
                <asp:HiddenField ID="TextRestrictField2HiddenField" runat="server" />

                <div id="TextRestrictRelatedDiv" runat="server">
                    <asp:DropDownList ID="ddlTextRestrictRelated" runat="server"></asp:DropDownList>
                </div>

                <div id="TextRestrictRestrictByDiv" runat="server">
                    <asp:DropDownList ID="ddlTextRestrictRestrictByFrom" runat="server"></asp:DropDownList>&nbsp;&nbsp;&nbsp;
                    <asp:DropDownList ID="ddlTextRestrictRestrictByTo" runat="server"></asp:DropDownList>
                </div>

                <div id="TextRestrictTimeIntervalDiv" runat="server">
                    <table border="0" cellpadding="0" cellspacing="0"><tr>
                        <td><div class="form-horizontal"><div class="input-append datepicker">
                            <asp:TextBox ID="txtTextRestrictTimeIntervalFrom" runat="server" data-date-format="dd/mm/yyyy" CssClass="input-small"></asp:TextBox><span class="add-on"><i class="icon-calendar"></i></span>
                        </div></div></td>
                        <td>&nbsp;&nbsp;to&nbsp;&nbsp;</td>
                        <td><div class="form-horizontal"><div class="input-append datepicker">
                            <asp:TextBox ID="txtTextRestrictTimeIntervalTo" runat="server" data-date-format="dd/mm/yyyy" CssClass="input-small"></asp:TextBox><span class="add-on"><i class="icon-calendar"></i></span>
                        </div></div></td>
                    </tr></table>
                </div>

            </div>

        </div><!-- tabs-text-restrict ends -->

        <div id="tabs-radiology-specify" class="tab-pane">
                
            <div id="RadiologyRadioSetDiv" class="span3">
                <p><asp:RadioButton ID="rbtnMRI" Text="MRI" GroupName="RadiologyRadioGroup" runat="server" /></p>
                <p><asp:RadioButton ID="rbtnCT" Text="CT" GroupName="RadiologyRadioGroup" runat="server" /></p>
                <p><asp:RadioButton ID="rbtnXRay" Text="X-Ray" GroupName="RadiologyRadioGroup" runat="server" /></p>
                <p><asp:RadioButton ID="rbtnUSG" Text="USG" GroupName="RadiologyRadioGroup" runat="server" /></p>
            </div>

            <div id="RadiologyListContainer" class="span7">
                
                <asp:HiddenField ID="RadiologyIdHiddenField" runat="server" />
                
                <div id="MRIListDiv" runat="server">

                    <asp:TextBox ID="txtMRIListQuickFind" runat="server" placeholder="Type keywords to filter codes"></asp:TextBox>
                    <asp:GridView ID="MRIListGridView" runat="server" AutoGenerateColumns="False"
                        GridLines="None" CellSpacing="-1" 
                        CssClass="table table-bordered" 
                        onprerender="MRIListGridView_PreRender">
                        <Columns>
                            <asp:BoundField DataField="Name" HeaderText="Code" />
                            <asp:BoundField DataField="Description" HeaderText="Description" />
                            <asp:TemplateField>
                                <itemtemplate>
                                    <asp:HiddenField ID="CodeIdHiddenField" Value='<%#Eval("Id") %>' runat="server" />
                                    <a href="#" class="btn radiology-select-code" title="Select this code"><i class="icon-ok"></i></a>
                                </itemtemplate>
                                <ItemStyle CssClass="center" />
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>

                </div>
                    
                <div id="CTListDiv" runat="server">

                    <asp:TextBox ID="txtCTListQuickFind" runat="server" placeholder="Type keywords to filter codes"></asp:TextBox>
                    <asp:GridView ID="CTListGridView" runat="server" AutoGenerateColumns="False"
                        GridLines="None" CellSpacing="-1" 
                        CssClass="table table-bordered" 
                        onprerender="CTListGridView_PreRender">
                        <Columns>
                            <asp:BoundField DataField="Name" HeaderText="Code" />
                            <asp:BoundField DataField="Description" HeaderText="Description" />
                            <asp:TemplateField>
                                <itemtemplate>
                                    <asp:HiddenField ID="CodeIdHiddenField" Value='<%#Eval("Id") %>' runat="server" />
                                    <a href="#" class="btn radiology-select-code" title="Select this code"><i class="icon-ok"></i></a>
                                </itemtemplate>
                                <ItemStyle CssClass="center" />
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>

                </div>
                    
                <div id="XRayListDiv" runat="server">

                    <asp:TextBox ID="txtXRayListQuickFind" runat="server" placeholder="Type keywords to filter codes"></asp:TextBox>
                    <asp:GridView ID="XRayListGridView" runat="server" AutoGenerateColumns="False"
                        GridLines="None" CellSpacing="-1" 
                        CssClass="table table-bordered" 
                        onprerender="XRayListGridView_PreRender">
                        <Columns>
                            <asp:BoundField DataField="Name" HeaderText="Code" />
                            <asp:BoundField DataField="Description" HeaderText="Description" />
                            <asp:TemplateField>
                                <itemtemplate>
                                    <asp:HiddenField ID="CodeIdHiddenField" Value='<%#Eval("Id") %>' runat="server" />
                                    <a href="#" class="btn radiology-select-code" title="Select this code"><i class="icon-ok"></i></a>
                                </itemtemplate>
                                <ItemStyle CssClass="center" />
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>

                </div>

                <div id="USGListDiv" runat="server">

                    <asp:TextBox ID="txtUSGListQuickFind" runat="server" placeholder="Type keywords to filter codes"></asp:TextBox>
                    <asp:GridView ID="USGListGridView" runat="server" AutoGenerateColumns="False"
                        GridLines="None" CellSpacing="-1" 
                        CssClass="table table-bordered" 
                        onprerender="USGListGridView_PreRender">
                        <Columns>
                            <asp:BoundField DataField="Name" HeaderText="Code" />
                            <asp:BoundField DataField="Description" HeaderText="Description" />
                            <asp:TemplateField>
                                <itemtemplate>
                                    <asp:HiddenField ID="CodeIdHiddenField" Value='<%#Eval("Id") %>' runat="server" />
                                    <a href="#" class="btn radiology-select-code" title="Select this code"><i class="icon-ok"></i></a>
                                </itemtemplate>
                                <ItemStyle CssClass="center" />
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>

                </div>
                
            </div>

        </div><!-- tabs-radiology-specify ends -->

        <div id="tabs-radiology-restrict" class="tab-pane">

            <div id="RadiologyRestrictRadioSetDiv" class="span3">
                <p><asp:RadioButton ID="rbtnRadiologyRestrictRelated" Text="Related To" GroupName="RadiologyRestrictRadioGroup" runat="server" /></p>
                <p><asp:RadioButton ID="rbtnRadiologyRestrictRestrictBy" Text="Restrict By" GroupName="RadiologyRestrictRadioGroup" runat="server" /></p>
                <p><asp:RadioButton ID="rbtnRadiologyRestrictTimeInterval" Text="Time Interval" GroupName="RadiologyRestrictRadioGroup" runat="server" /></p>
            </div>

            <div id="RadiologyRestrictListContainer" class="span7">
                    
                <asp:HiddenField ID="RadiologyRestrictField1HiddenField" runat="server" />
                <asp:HiddenField ID="RadiologyRestrictField2HiddenField" runat="server" />

                <div id="RadiologyRestrictRelatedDiv" runat="server">
                    <asp:DropDownList ID="ddlRadiologyRestrictRelated" runat="server"></asp:DropDownList>
                </div>

                <div id="RadiologyRestrictRestrictByDiv" runat="server">
                    <asp:DropDownList ID="ddlRadiologyRestrictRestrictByFrom" runat="server"></asp:DropDownList>&nbsp;&nbsp;&nbsp;
                    <asp:DropDownList ID="ddlRadiologyRestrictRestrictByTo" runat="server"></asp:DropDownList>
                </div>

                <div id="RadiologyRestrictTimeIntervalDiv" runat="server">
                    <table border="0" cellpadding="0" cellspacing="0"><tr>
                        <td><div class="form-horizontal"><div class="input-append datepicker">
                            <asp:TextBox ID="txtRadiologyRestrictTimeIntervalFrom" runat="server" data-date-format="dd/mm/yyyy" CssClass="input-small"></asp:TextBox><span class="add-on"><i class="icon-calendar"></i></span>
                        </div></div></td>
                        <td>&nbsp;&nbsp;to&nbsp;&nbsp;</td>
                        <td><div class="form-horizontal"><div class="input-append datepicker">
                            <asp:TextBox ID="txtRadiologyRestrictTimeIntervalTo" runat="server" data-date-format="dd/mm/yyyy" CssClass="input-small"></asp:TextBox><span class="add-on"><i class="icon-calendar"></i></span>
                        </div></div></td>
                    </tr></table>
                </div>

            </div>

        </div><!-- tabs-radiology-restrict ends -->

        <div id="tabs-snomed-ct-specify" class="tab-pane">
                
            <div id="SnomedCtRadioSetDiv" class="span3">
                <p><asp:RadioButton ID="rbtnSnomedCt" Text="SNOMED-CT" GroupName="snomedCtNumber" runat="server" /></p>
            </div>

            <div id="SnomedCtListContainer" class="span7">

                <asp:HiddenField ID="SnomedCtIdHiddenField" runat="server" />
                <div id="SelectedSnomedCt" runat="server">

                    <asp:TextBox ID="txtSnomedCtListQuickFind" runat="server" placeholder="Type keywords to filter codes"></asp:TextBox>
                    <asp:GridView ID="SnomedCtGridView" runat="server"
                            AutoGenerateColumns="False" GridLines="None" CellSpacing="-1"
                            CssClass="table table-bordered" 
                            onprerender="SnomedCtGridView_PreRender">
                            <Columns>
                            <asp:BoundField DataField="Name" HeaderText="Code" />
                            <asp:BoundField DataField="Description" HeaderText="Description" />
                            <asp:TemplateField>
                                <itemtemplate>
                                    <asp:HiddenField ID="CodeIdHiddenField" Value='<%#Eval("Id") %>' runat="server" />
                                    <a href="#" class="btn select-snomedct-code" title="Select this code"><i class="icon-ok"></i></a>
                                </itemtemplate>
                                <ItemStyle CssClass="center" />
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>

                </div>

            </div>

        </div><!-- tabs-snomed-ct-specify ends -->

        <div id="tabs-snomed-ct-restrict" class="tab-pane">

            <div id="SnomedCtRestrictRadioSetDiv" class="span3">
                <p><asp:RadioButton ID="rbtnSnomedCtRestrictRelated" Text="Related To" GroupName="SnomedCtRestrictRadioGroup" runat="server" /></p>
                <p><asp:RadioButton ID="rbtnSnomedCtRestrictRestrictBy" Text="Restrict By" GroupName="SnomedCtRestrictRadioGroup" runat="server" /></p>
                <p><asp:RadioButton ID="rbtnSnomedCtRestrictTimeInterval" Text="Time Interval" GroupName="SnomedCtRestrictRadioGroup" runat="server" /></p>
            </div>

            <div id="SnomedCtRestrictListContainer" class="span7">
                    
                <asp:HiddenField ID="SnomedCtField1HiddenField" runat="server" />
                <asp:HiddenField ID="SnomedCtField2HiddenField" runat="server" />

                <div id="SnomedCtRestrictRelatedDiv" runat="server">
                    <asp:DropDownList ID="ddlSnomedCtRestrictRelated" runat="server"></asp:DropDownList>
                </div>

                <div id="SnomedCtRestrictRestrictByDiv" runat="server">
                    <asp:DropDownList ID="ddlSnomedCtRestrictRestrictByFrom" runat="server"></asp:DropDownList>&nbsp;&nbsp;&nbsp;
                    <asp:DropDownList ID="ddlSnomedCtRestrictRestrictByTo" runat="server"></asp:DropDownList>
                </div>

                <div id="SnomedCtRestrictTimeIntervalDiv" runat="server">
                    <table border="0" cellpadding="0" cellspacing="0"><tr>
                        <td><div class="form-horizontal"><div class="input-append datepicker">
                            <asp:TextBox ID="txtSnomedCtRestrictTimeIntervalFrom" runat="server" data-date-format="dd/mm/yyyy" CssClass="input-small"></asp:TextBox><span class="add-on"><i class="icon-calendar"></i></span>
                        </div></div></td>
                        <td>&nbsp;&nbsp;to&nbsp;&nbsp;</td>
                        <td><div class="form-horizontal"><div class="input-append datepicker">
                            <asp:TextBox ID="txtSnomedCtRestrictTimeIntervalTo" runat="server" data-date-format="dd/mm/yyyy" CssClass="input-small"></asp:TextBox><span class="add-on"><i class="icon-calendar"></i></span>
                        </div></div></td>
                    </tr></table>
                </div>

            </div>

        </div><!-- tabs-snomed-ct-restrict ends -->
        
        </div><%--tab-content ends--%>


        <p style="padding: 20px 20px 0; text-align: right;">
            <a href="#" id="BackTab" class="btn" disabled="disabled"><i class="icon-arrow-left"></i> Back</a>&nbsp;&nbsp;&nbsp;
            <asp:Button ID="SaveButton" runat="server" Text="Save" CssClass="btn btn-primary" onclick="SaveButton_Click" />&nbsp;&nbsp;&nbsp;
            <a href="#" id="NextTab" class="btn">Next <i class="icon-arrow-right"></i></a>
        </p>


        <asp:HiddenField ID="InclusionOrParameterIdHiddenField" runat="server" />
        <asp:HiddenField ID="OutcomeIdHiddenField" runat="server" />
        <asp:HiddenField ID="CurrentTabHiddenField" runat="server" />

    </div><!--body ends-->


</asp:Content>
